Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add perc progress of trx tax report #394

Merged

Conversation

ZIMkaRU
Copy link
Member

@ZIMkaRU ZIMkaRU commented Jul 19, 2024

This PR adds perc progress of the trx tax report based on transactions that should be converted to USD using the pub-trade endpoint

in this case, we should understand that the first 10% can be faster than the next 10% (just an example)


Emits emitTrxTaxReportGenerationProgressToOne event by the WS with object:

{
  progress: Number | null,
  state: String | null
}

The state field is one from the list:

  • GENERATION_STARTED
  • OBTAINING_CURRENCY_PRICES
  • TRANSACTION_HISTORY_GENERATION
  • GENERATION_COMPLETED
  • GENERATION_INTERRUPTED

WS event examples:

{
  "jsonrpc": "2.0",
  "result": {
    "progress": 0,
    "state": "GENERATION_STARTED"
  },
  "id": null,
  "action": "emitTrxTaxReportGenerationProgressToOne"
}
{
  "jsonrpc": "2.0",
  "result": {
    "progress": 36,
    "state": "OBTAINING_CURRENCY_PRICES"
  },
  "id": null,
  "action": "emitTrxTaxReportGenerationProgressToOne"
}
{
  "jsonrpc": "2.0",
  "result": {
    "progress": 99,
    "state": "TRANSACTION_HISTORY_GENERATION"
  },
  "id": null,
  "action": "emitTrxTaxReportGenerationProgressToOne"
}
{
  "jsonrpc": "2.0",
  "result": {
    "progress": 100,
    "state": "GENERATION_COMPLETED"
  },
  "id": null,
  "action": "emitTrxTaxReportGenerationProgressToOne"
}
{
  "jsonrpc": "2.0",
  "result": {
    "progress": null, // if gen is interrupted progress will always be null
    "state": "GENERATION_INTERRUPTED"
  },
  "id": null,
  "action": "emitTrxTaxReportGenerationProgressToOne"
}

Copy link
Contributor

@ezewer ezewer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants